home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWViews / Include / FWViews.k < prev   
Encoding:
Text File  |  1996-08-16  |  4.7 KB  |  114 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //    File:                FWViews.k
  3. //    Release Version:    $ ODF 1 $
  4. //
  5. //    Constants shared between the framework code and view resources
  6. //
  7. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  8. //========================================================================================
  9.  
  10. #ifndef FWVIEWS_K
  11. #define FWVIEWS_K
  12.  
  13. //----------------------------------------------------------------------------------------
  14. // Resource Types
  15. //----------------------------------------------------------------------------------------
  16.  
  17. #ifdef FW_BUILD_MAC
  18. #define FW_kViewLayoutType        'FWvl'
  19. #define FW_kFontType            'FWft'
  20. #endif
  21.  
  22. //----------------------------------------------------------------------------------------
  23. // View Bindings
  24. //----------------------------------------------------------------------------------------
  25. // These constants are used to define the layout maganement of subviews inside a superview
  26. // which is being resized.
  27. //     - Each side of a FW_CView object can remain at a fixed distance to its parent view 
  28. //      with the left/right/top/bottom binding values set.
  29. //     - You can also combine that with a fixed width or height (not all combinations are valid)
  30. //
  31. // By default a FW_CView object is created with a FW_kFixedBounds binding, which means that
  32. // it doesn't move when its parent view is resized.
  33. // Some subclasses of FW_CView override this with other default values:
  34. //     - FW_CSuperView's default binding = FW_kFitToEnclosure.
  35. //     - FW_CScrollBar's default binding =  FW_kVScrollBarBinding or FW_kHScrollBarBinding
  36. //     - FW_CGrowBox's default binding = FW_kGrowBoxBinding
  37. //
  38. // When declaring views in a .fr resource file you must enter the default value or any
  39. // other ones that make sense (leaving 0 means no binding at all and it won't yield good
  40. // results in general).  Of course the binding value will be ignored if you provide your
  41. // own layout management code in MyView::AdjustToNewLayout().
  42.  
  43. #define FW_kNoBinding         0x00000000
  44. #define FW_kLeftBinding     0x00000001
  45. #define FW_kRightBinding     0x00000002
  46. #define FW_kTopBinding         0x00000004
  47. #define FW_kBottomBinding     0x00000008
  48. #define FW_kFixedWidth         0x00000010
  49. #define FW_kFixedHeight     0x00000020
  50.  
  51. #define FW_kFixedLocation    (FW_kLeftBinding + FW_kTopBinding)
  52. #define FW_kFixedSize        (FW_kFixedWidth + FW_kFixedHeight)
  53. #define FW_kFixedBounds        (FW_kFixedLocation + FW_kFixedSize)
  54. #define FW_kFitToEnclosure    (FW_kFixedLocation + FW_kRightBinding + FW_kBottomBinding)
  55.  
  56. #define FW_kVScrollBarBinding     (FW_kTopBinding+FW_kRightBinding+FW_kFixedWidth+FW_kBottomBinding)
  57. #define FW_kHScrollBarBinding    (FW_kLeftBinding+FW_kBottomBinding+FW_kFixedHeight+FW_kRightBinding)
  58.  
  59. #define FW_kGrowBoxBinding        (FW_kBottomBinding+FW_kRightBinding+FW_kFixedSize)
  60.  
  61. //----------------------------------------------------------------------------------------
  62. // View scrolling direction
  63. //----------------------------------------------------------------------------------------
  64.  
  65. enum FW_EScrollingDirection 
  66. {
  67.     FW_kNoScrolling    = 0x0000,
  68.     FW_kXScrolling    = 0x0001,
  69.     FW_kYScrolling    = 0x0010,
  70.     FW_kXYScrolling    = 0x0011
  71. };
  72.  
  73. //----------------------------------------------------------------------------------------
  74. // Control receivers
  75. //----------------------------------------------------------------------------------------
  76. // Use the constants below to define which receiver handles the control's message.
  77. // (mainly used for push buttons)
  78. // Warning: if you want the control's view or the frame to be the receiver
  79. //            you need to be sure that its class inherits from FW_MReceiver
  80.  
  81. #define FW_kNoReceiver            0
  82. #define FW_kViewReceiver        1
  83. #define FW_kFrameReceiver        2
  84.  
  85. // Scroll-bars are a special case, the scroller is always the default receiver
  86. #define FW_kScrollerReceiver    0
  87.  
  88. //----------------------------------------------------------------------------------------
  89. // Button kinds
  90. //----------------------------------------------------------------------------------------
  91.  
  92. #define FW_kPushButton            0
  93. #define FW_kRadioButton            1
  94. #define FW_kCheckButton            2
  95. #define FW_kDefaultPushButton    3
  96.  
  97. #define FW_kMaxButtonKind        FW_kDefaultPushButton
  98.  
  99. //----------------------------------------------------------------------------------------
  100. // Reserved Object IDs for preregistering the root view
  101. //----------------------------------------------------------------------------------------
  102.  
  103. #define FW_kPreregisteredRootViewObject     -301
  104. #define FW_kPreregisteredFrameObject         -303
  105.  
  106. //----------------------------------------------------------------------------------------
  107. // Useful defines
  108. //----------------------------------------------------------------------------------------
  109.  
  110. #define FW_MAXINT16        32767
  111. #define FW_MININT16        -32768
  112.  
  113. #endif
  114.